extends "../cTDP_3/cTDP_3.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "先知"
	lv = 3
	attCoe.atk = 30 / 8.5 * 2 / 3
	attCoe.maxHp = 800.5 / 112.5 / 3
	addCdSkill("xz",7)
	addCdSkill("xz1",9)
	addSkillTxt("克里托之剑：提高攻击范围内友方攻击50%，持续2秒[cd:7秒]")
	addSkillTxt("亚伯拉罕盾：为生命比最低的友方添加一层护盾[护盾值：200 + 自身血量上限1%][cd：9秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	var chas = getAllChas(2)
	chas.sort_custom(self,"sort")
	if id == "xz":
		cst("克里托之剑","000000",position)
		if !chas.size():return
		for i in chas:
			if !inrange(i.cell,cell,att.atkRan):continue
			i.addBuff(BF.new(1))

	if id == "xz1":
		if !chas[0]:return
		cst("亚伯拉罕盾","000000",position)	
		chas[0].changeShield(200 + att.maxHp * 0.01)

func inrange(a,b,c):
	var x = abs(a.x - b.x)
	var y = abs(a.y - b.y)
	return x*x + y*y <= c*c
class BF:
	extends Buff
	func _init(lv):
		attInit()
		life = lv * 2
		att.atkL = 0.5